
<%-- 
    Document   : friends.jsp
    Created on : Apr 3, 2012, 1:53:22 AM
    Author     : Mr. Hung
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" media="all" />
        <link href="style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="javascript/general.js"></script>
        <script type="text/javascript" src="javascript/accept_request.js"></script>
        <script type="text/javascript" src="javascript/deny_request.js"></script>
        <title>Request list</title>
    </head>
    <body>
        <!--        Now for testing new body code-->
        <c:import url="/header.jsp"/>
        <c:import url="/leftbar.jsp"/>
        
        <div id="wrapper">
            <div id="content_wrapper"><span class="top"></span><span class="bottom"></span>
                <div id="content">
                    <div class="welcome_stt_box"> 
                        <h2>Request list (${totalResults})</h2>
                    </div>
                    <br>
                    <c:if test="${fn:length(requestList) > 0}">
                        
                        <table cellspacing="7">
                            <c:forEach var="acc" items="${requestList}">
                                <tr>
                                    <td width="100">
                                        <a href="<c:url value="/ViewPersonalInfo">
                                               <c:param name="accountId" value="${acc.accountId}"/>
                                           </c:url>"><img src="${acc.avatar}" height="80" width="80">
                                        </a>
                                    </td>
                                    <td width="250">
                                        <a href="<c:url value="/ViewPersonalInfo">
                                               <c:param name="accountId" value="${acc.accountId}"/>
                                           </c:url>"><h5>
                                                ${acc.username}</h5></a>
                                        Age&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp: ${acc.age}<br>
                                        Gender&nbsp: ${acc.gender}<br>
                                        Address: ${acc.location.address}
                                    </td>
                                    <td valign="bottom" width="80">
                                        <form id>
                                            <input class="btn" type="button" id="accept" value="Confirm" onclick="acceptRequest(this.form)">
                                            <input type="hidden" name="requestId" value="${acc.accountId}">
                                            </td>
                                            <td valign="bottom">
                                                <input class="btn" type="button" value="Decline" id="deny" onclick="denyRequest(this.form)">
                                        </form>
                                    </td>
                                    <td width="50"></td>
                                </tr>
                                <tr>
                                    <td colspan="5">
                                        <div class="welcome_box">
                                        </div>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                        
                    </c:if>
                    <c:if test="${fn:length(requestList) < totalResults}">
                        <form action="ViewRequestList">
                            <input class="btn" type="submit" value="More Results">
                            <input type="hidden" name="numOfResults" value="${fn:length(requestList) + incrementOfResults}">
                        </form>
                    </c:if>
                </div> <!-- end of content -->
                
                <%-- import side bar --%>
                <c:import url="/sidebar.jsp"/>
                
                <div class="cleaner"></div>
            </div>
            
            <div class="cleaner"></div>
            
        </div> <!-- end of content_wrapper -->
        
        <c:import url="/footer.jsp"/>
        
    </body>
</html>